package com.ah.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/* 只需要在需要动态读取配置的类上添加此注解就可以 */
@RefreshScope
@RestController
public class HelloController {
    @Value("${hello.message}")
    private String message;

    @RequestMapping("/message")
    public String message(){
        return message;
    }

}
